@extends('layouts.default')
@section('seo-title', $news['seo_title'])
@section('seo-description',$news['seo_description'])
@section('seo-keywords',$news['seo_keyword'])
@section('company',$all_model['abbreviation'])
@section('link-css')
    <link rel="stylesheet" href="/css/publicStyle/newsDesc.css">
@endsection
@section('content')
    @include('layouts._headerElse')
    <!--  面包蟹  -->
    <div class="container">
        <div class="bread-crumbs visible-md visible-lg">
            <div class="bread-crumbs-header">返回位置：</div>
            <ul class="breadcrumb">
                <li><a href="{{route('newsList')}}">资讯列表</a></li>
            </ul>
        </div>
    </div>
    <!--  内容  -->
    <div class="news-detail">
        <div class="container">
            <div class="row">
                <div class="news-details col-md-9 col-sm-8">
                    <h3 class="news-details-title">{{$news['title']}}</h3>
                    <div class="news-details-times">
                        <div class="news-details-img">
                            {{$news['author']}}
                        </div>
                        <p class="news-details-time">{{$news['created_at']}}</p>
                    </div>
                    <h4 class="news-details-content">
                        {!! $news['details'] !!}
                    </h4>
                </div>
                <div class="news-details-read col-md-3 col-sm-4 hidden-xs">
                    <div class="news-details-reads">
                        <div class="read">
                            <span>推荐阅读</span>
                            @empty(!$recommend_news['next_page_url'])
                                <a class="glyphicon glyphicon-refresh batch"
                                   data-next_page_url="{{$recommend_news['next_page_url']}}"> 换一批</a>
                            @endif
                        </div>
                        <ul class="news-details-reads-ul">
                            @foreach ($recommend_news['data'] as $index=>$item)
                                <li>
                                    <div class="read-icon">
                                        @if ($loop->iteration == 1)
                                            <img src="/image/one.png" alt="">
                                        @elseif ($loop->iteration == 2)
                                            <img src="/image/two.png" alt="">
                                        @elseif ($loop->iteration == 3)
                                            <img src="/image/three.png" alt="">
                                        @elseif ($loop->iteration > 3 && $loop->iteration < 10)
                                            <img src="/image/all.png" alt="">
                                            <span>{{ $loop->iteration}}</span>
                                        @else
                                            <img src="/image/all.png" alt="">
                                            <span class="read-icon-new">{{ $loop->iteration}}</span>
                                        @endif
                                    </div>
                                    <a href="{{route('newsDetails', [$item['id']])}}">{{ $item['title'] }}</a>
                                </li>
                            @endforeach
                        </ul>
                    </div>
                </div>
            </div>
            <div class="details-title visible-md visible-lg">
                @empty(!$prev)
                    <a href="/newsDetails/{{$prev['id']}}" class="details-previous">上一条: {{$prev['title']}}</a>
                @endif
                @empty(!$next)
                    <a href="/newsDetails/{{$next['id']}}" class="details-next">下一条: {{$next['title']}}</a>
                @endif
            </div>
        </div>
    </div>
@endsection
<script type="text/javascript">
    window.onload = function () {
        $('.left-fixed .round').each(function (index) {
            $(this).on('click', function () {
                $('body, html').animate({
                    scrollTop: $('.processing-content').eq(index).offset().top
                })
            })
        })
    }
</script>
